﻿@*
	Iván Loire - www.iloire.com
	Please readme README file for license terms.

	ASP.NET MVC3 ACME Invocing app (demo app for training purposes)
*@

@{
    ViewBag.Title = "ByYear";
}
@model int
           
<h1>Year @Model</h1>


@{
    DateTime startQ1 = new DateTime(Model, 1, 1);
    DateTime startQ2 = new DateTime(Model, 4, 1);
    DateTime startQ3 = new DateTime(Model, 7, 1);
    DateTime startQ4 = new DateTime(Model, 10, 1);
}


<h2>@Model Year balance</h2>
<div class="periodSummary alert-message warning">
@{Html.RenderAction("PeriodSummary", "Reports", new { fromDate = startQ1, toDate = startQ1.AddYears(1).AddDays(-1) });}
</div>


<div class="periodSummary">
<h2>Q1</h2>
@{Html.RenderAction("PeriodSummary", "Reports", new { fromDate = startQ1, toDate = startQ2.AddDays(-1) });}
@{Html.RenderAction("QuarterDetailsPartial", "Reports", new { quarter = 1, year = Model});}
</div>


<div class="periodSummary">
<h2>Q2</h2>
@{Html.RenderAction("PeriodSummary", "Reports", new { fromDate = startQ2, toDate = startQ3.AddDays(-1) });}
@{Html.RenderAction("QuarterDetailsPartial", "Reports", new { quarter = 2, year = Model });}
</div>

<div class="periodSummary">
<h2>Q3</h2>
@{Html.RenderAction("PeriodSummary", "Reports", new { fromDate = startQ3, toDate = startQ4.AddDays(-1) });}
@{Html.RenderAction("QuarterDetailsPartial", "Reports", new { quarter = 3, year = Model });}
</div>

<div class="periodSummary">
<h2>Q4</h2>
@{Html.RenderAction("PeriodSummary", "Reports", new { fromDate = startQ4, toDate = startQ1.AddYears(1).AddDays(-1) });}
@{Html.RenderAction("QuarterDetailsPartial", "Reports", new { quarter = 4, year = Model });}
</div>
